// JavaScript Document

function showoption()
{
	if(document.getElementById('Input').checked==true)
	{
	  document.getElementById('board-inactive').style.display="none"; 
	  if(keysCaps == true) {
	  	document.getElementById('board-active-caps').style.display="";
	  	document.getElementById('board-active').style.display="none";
	  }
	  else {
	    document.getElementById('board-active').style.display="";
	    document.getElementById('board-active-caps').style.display="none";
	  }
	}
	if(document.getElementById('Input').checked==false)
	{
	  document.getElementById('board-inactive').style.display=""; 
	  if( document.getElementById('board-active').style.display == "") {
	  	 keysCaps = false;
	  }
	  else if(document.getElementById('board-active-caps').style.display =="") {
	  	keysCaps = true;
	  }
	  document.getElementById('board-active').style.display="none";
	  document.getElementById('board-active-caps').style.display="none";
	}
}

function main()
{
document.location.href = "main.htm";
}

function enterVirtualKey(virtualKey) {
    var password =document.all.uipassword.value;
    if(virtualKey == 'bksp') {
        var password =document.all.uipassword.value;
        if(password.length > 0) {
            password = password.substring(0,password.length - 1);	
        }    	
    }
    else if(virtualKey == 'clr') {
    	password = "";
    }
    else if(virtualKey == 'caps') {
    	if(document.getElementById('board-active').style.display == "") {
    	    document.getElementById('board-inactive').style.display="none"; 
    	    document.getElementById('board-active').style.display = "none";
    	    document.getElementById('board-active-caps').style.display = "";
    	    keysCaps = true;
    	}
    	else if(document.getElementById('board-active-caps').style.display == "") {
	    document.getElementById('board-inactive').style.display="none"; 
	    document.getElementById('board-active-caps').style.display = "none";
    	    document.getElementById('board-active').style.display = "";
    	    keysCaps = false;
    	}
    }
    else {
    	password = password + virtualKey;
    }
    document.all.uipassword.value = password
}
